package com.example.agriculturemachine.ui.fragment;

import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.example.agriculturemachine.R;
import com.example.agriculturemachine.base.BaseFragment;
import com.example.agriculturemachine.ui.activity.AnalysisActivity;
import com.example.agriculturemachine.ui.activity.MainActivity;
import com.example.agriculturemachine.ui.activity.PenLinActivity;
import com.example.agriculturemachine.ui.activity.controlActivity;

import butterknife.BindView;

public class managerFragment extends BaseFragment {
    @BindView(R.id.control)
    public ImageView control;
    @BindView(R.id.penLin)
    public ImageView penLin;
    @BindView(R.id.data_analysis)
    public ImageView data_analysis;
    @BindView(R.id.other)
    public ImageView other;
    @BindView(R.id.back)
    public ImageView back;

    @Override
    protected View loadRootView(LayoutInflater inflater, ViewGroup container) {
        return inflater.inflate(R.layout.fragment_manager,container,false);
    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initEvent() {
       control.setOnClickListener(new View.OnClickListener() {
           @Override
           public void onClick(View v) {
               startActivity(new Intent(getActivity(), controlActivity.class));

           }
       });
        penLin.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(getActivity(), PenLinActivity.class));
            }
        });
        data_analysis.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(getActivity(), AnalysisActivity.class));
            }
        });
        other.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ((MainActivity)getActivity()).switchFragment(new selectFragment());
            }
        });


    }
}
